$(document).ready(function(){
    $("#new_user_form").submit(function(event){
      event.preventDefault();
      // verifié data avant envoier
      var form_data = $("#new_user_form").serialize();
      console.log(form_data);
      $.post("include/create_user.php", form_data,
             function(result){
                 if(result["succes"]){
                     window.location.href = "index.php"
                     console.log("user created");
                 } else {
                     alert("error: " + result["msg"]);
                 }
             },"json");
    });
});
